# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=ruby-snmp
_gemname=snmp
pkgver=1.3.2
pkgrel=10
pkgdesc='A Ruby implementation of SNMP (the Simple Network Management Protocol).'
arch=('any')
license=('MIT')
makedepends=('ruby')
url='https://rubygems.org/gems/snmp'
source=("https://rubygems.org/gems/snmp-1.3.2.gem")
sha512sums=('e2ccf2d7ae370b08e5890155f24b911a31aaf944a49aee7fa9654b4970d8ab2e3bbc0fa365c7a2977da0951d5ebb0123d064df4b458648518cb8e8968229d6f4')
noextract=("$_gemname-$pkgver.gem")

package() {
  _gemdir=$(ruby -e 'puts Gem.default_dir')

  if [[ $CARCH == arm* ]] ; then
    gem install --no-user-install --ignore-dependencies --no-rdoc --no-ri \
      -i "$pkgdir$_gemdir" "$_gemname-$pkgver.gem"
  else
    gem install --no-user-install --ignore-dependencies -i "$pkgdir$_gemdir" \
      -n "$pkgdir/usr/bin" "$_gemname-$pkgver.gem"
  fi
}

